/**
 * @param {number} lowLimit
 * @param {number} highLimit
 * @return {number}
 */
 var countBalls = function(lowLimit, highLimit) {
    let map = new Map()
    for(let i=lowLimit;i<=highLimit;i++){
      let res = 0
      for(let j=0;j<String(i).length;j++){
        res+=Number(String(i)[j])
      }
      map.set(res,map.has(res)?map.get(res)+1:1)
    }

    return Math.max(...map.values())
};

console.log(countBalls(19,28));